import { axios } from '@/utils/request'

// 文件上传
export function apiUploadFile (parameter, onUploadProgress) {
  return axios({
    url: '/back/file/upload',
    headers: {
      'Content-Type': 'multipart/form-data;boundary = ' + new Date().getTime()
    },
    method: 'post',
    data: parameter,
    onUploadProgress: onUploadProgress
  })
}

// 文件上传
export function apiUploadFileBase64 (parameter, onUploadProgress) {
  return axios({
    url: '/back/file/upload/base64',
    headers: {
      'Content-Type': 'text/plain'
    },
    method: 'post',
    data: parameter,
    onUploadProgress: onUploadProgress
  })
}

// 文件预览
export const VIEW_FILE_URL = '/back/file/view/'
